<template>
    <div>
        <h1>测试登录</h1>
        <input type="text" v-model="username">
        <button @click="login">登录到人工聊天</button>
        <button @click="login1">登录到AI聊天</button>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
const router = useRouter()
const username = ref('')
const login = () => {
    router.push({
        path: '/talking',
        query: { username: username.value }
    })
}
const login1 = () => {
    router.push({
        path: '/ai_chat',
        query: { username: username.value }
    })
}
</script>

<style scoped></style>